import { useDispatch, useSelector } from "react-redux";
import { fetchChannelList } from "./store/modules/channelStore";
function App() {
  const { channelList } = useSelector((state) => state.channel);
  const dispatch = useDispatch();
  const getData = () => {
    dispatch(fetchChannelList());
  };
  return (
    <div>
      <h2>app</h2>
      <p>
        <button onClick={getData}>获取数据</button>
      </p>
      <ul>
        {channelList.map((item) => (
          <li key={item.id}>{item.name}</li>
        ))}
      </ul>
    </div>
  );
}

export default App;
